//
//  YHMachineManagementPullDownRecordCell.m
//  YHApp
//
//  Created by -- on 2021/7/24.
//

#import "HAMachinePullDownRecordCell.h"
#import "HAMachinePullDownRecordMo.h"

@interface HAMachinePullDownRecordCell ()

/***/
@property (nonatomic, strong) UIView *mainV;
/***/
@property (nonatomic, strong) UILabel *tit1Label;
/***/
@property (nonatomic, strong) UILabel *tit2Label;
/***/
@property (nonatomic, strong) UILabel *tit3Label;
/***/
@property (nonatomic, strong) UILabel *tit4Label;
/***/
@property (nonatomic, strong) UILabel *tit5Label;
/***/
@property (nonatomic, strong) UILabel *tit6Label;
/***/
@property (nonatomic, strong) UILabel *con1Label;
/***/
@property (nonatomic, strong) UILabel *con2Label;
/***/
@property (nonatomic, strong) UILabel *con3Label;
/***/
@property (nonatomic, strong) UILabel *con4Label;
/***/
@property (nonatomic, strong) UILabel *con5Label;
/***/
@property (nonatomic, strong) UILabel *con6Label;

@end

@implementation HAMachinePullDownRecordCell

-(void)setModel:(HAMachinePullDownRecordMo *)model {
    _model = model;
    
    self.tit1Label.text = @"机具SN";
    self.tit2Label.text = @"产品型号";
    self.tit3Label.text = @"产品通道";
    self.tit4Label.text = @"下拨对象";
    self.tit5Label.text = @"拨发实际";
    self.tit6Label.text = @"机具状态";

    self.con1Label.text = _model.sn;
    self.con2Label.text = _model.productName;
    self.con3Label.text = _model.canalName;
    self.con4Label.text = _model.receiver;
    self.con5Label.text = _model.created_at;
    self.con6Label.text = _model.isBid;
}

-(void)layoutSubviews {
    [super layoutSubviews];
    
    self.contentView.backgroundColor = [UIColor khaBGColor];
    
    [self.mainV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(-10);
    }];
    
    [self.tit1Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(20);
        make.left.mas_equalTo(20);
        make.width.mas_offset(68);
        make.height.mas_offset(15);
    }];
    
    [self.con1Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.mas_equalTo(self.tit1Label);
        make.left.mas_equalTo(self.tit1Label.mas_right).offset(10);
    }];
    
    [self.tit2Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.tit1Label.mas_bottom).offset(20);
        make.left.mas_equalTo(20);
        make.width.mas_offset(68);
        make.height.mas_offset(15);
    }];
    
    [self.con2Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.mas_equalTo(self.tit2Label);
        make.left.mas_equalTo(self.tit2Label.mas_right).offset(10);
    }];

    [self.tit3Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.tit2Label.mas_bottom).offset(15);
        make.left.mas_equalTo(20);
        make.width.mas_offset(68);
        make.height.mas_offset(15);
    }];
    
    [self.con3Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.mas_equalTo(self.tit3Label);
        make.left.mas_equalTo(self.tit3Label.mas_right).offset(10);
    }];

    [self.tit4Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.tit3Label.mas_bottom).offset(15);
        make.left.mas_equalTo(20);
        make.width.mas_offset(68);
        make.height.mas_offset(15);
    }];
    
    [self.con4Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.mas_equalTo(self.tit4Label);
        make.left.mas_equalTo(self.tit4Label.mas_right).offset(10);
    }];

    [self.tit5Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.tit4Label.mas_bottom).offset(15);
        make.left.mas_equalTo(20);
        make.width.mas_offset(68);
        make.height.mas_offset(15);
    }];
    
    [self.con5Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.mas_equalTo(self.tit5Label);
        make.left.mas_equalTo(self.tit5Label.mas_right).offset(10);
    }];

    [self.tit6Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.tit5Label.mas_bottom).offset(15);
        make.left.mas_equalTo(20);
        make.width.mas_offset(68);
        make.height.mas_offset(15);
    }];
    
    [self.con6Label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.mas_equalTo(self.tit6Label);
        make.left.mas_equalTo(self.tit6Label.mas_right).offset(10);
    }];

}

- (UIView *)mainV
{
    if (!_mainV) {
        _mainV = [UIView ha_createView];
        _mainV.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_mainV];
    }
    return _mainV;
}

- (UILabel *)tit1Label
{
    if (!_tit1Label) {
        _tit1Label = [UILabel ha_BLabelWithFont:15 textColor:@"#45485D" text:@"" alignment:0];
        [self.mainV addSubview:_tit1Label];
    }
    return _tit1Label;
}

- (UILabel *)con1Label
{
    if (!_con1Label) {
        _con1Label = [UILabel ha_BLabelWithFont:15 textColor:@"#45485D" text:@"" alignment:2];
        [self.mainV addSubview:_con1Label];
    }
    return _con1Label;
}

- (UILabel *)tit2Label
{
    if (!_tit2Label) {
        _tit2Label = [UILabel ha_NLabelWithFont:15 textColor:@"#858b9c" text:@"" alignment:0];
        [self.mainV addSubview:_tit2Label];
    }
    return _tit2Label;
}

- (UILabel *)con2Label
{
    if (!_con2Label) {
        _con2Label = [UILabel ha_NLabelWithFont:15 textColor:@"#45485D" text:@"" alignment:2];
        [self.mainV addSubview:_con2Label];
    }
    return _con2Label;
}

- (UILabel *)tit3Label
{
    if (!_tit3Label) {
        _tit3Label = [UILabel ha_NLabelWithFont:15 textColor:@"#858b9c" text:@"" alignment:0];
        [self.mainV addSubview:_tit3Label];
    }
    return _tit3Label;
}

- (UILabel *)con3Label
{
    if (!_con3Label) {
        _con3Label = [UILabel ha_NLabelWithFont:15 textColor:@"#45485D" text:@"" alignment:2];
        [self.mainV addSubview:_con3Label];
    }
    return _con3Label;
}

- (UILabel *)tit4Label
{
    if (!_tit4Label) {
        _tit4Label = [UILabel ha_NLabelWithFont:15 textColor:@"#858b9c" text:@"" alignment:0];
        [self.mainV addSubview:_tit4Label];
    }
    return _tit4Label;
}

- (UILabel *)con4Label
{
    if (!_con4Label) {
        _con4Label = [UILabel ha_NLabelWithFont:15 textColor:@"#45485D" text:@"" alignment:2];
        [self.mainV addSubview:_con4Label];
    }
    return _con4Label;
}

- (UILabel *)tit5Label
{
    if (!_tit5Label) {
        _tit5Label = [UILabel ha_NLabelWithFont:15 textColor:@"#858b9c" text:@"" alignment:0];
        [self.mainV addSubview:_tit5Label];
    }
    return _tit5Label;
}

- (UILabel *)con5Label
{
    if (!_con5Label) {
        _con5Label = [UILabel ha_NLabelWithFont:15 textColor:@"#45485D" text:@"" alignment:2];
        [self.mainV addSubview:_con5Label];
    }
    return _con5Label;
}

- (UILabel *)tit6Label
{
    if (!_tit6Label) {
        _tit6Label = [UILabel ha_NLabelWithFont:15 textColor:@"#858b9c" text:@"" alignment:0];
        [self.mainV addSubview:_tit6Label];
    }
    return _tit6Label;
}

- (UILabel *)con6Label
{
    if (!_con6Label) {
        _con6Label = [UILabel ha_NLabelWithFont:15 textColor:@"#45485D" text:@"" alignment:2];
        [self.mainV addSubview:_con6Label];
    }
    return _con6Label;
}


@end
